Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

196
Views
"reaccionar" Cada niño en una lista debe tener un accesorio de "clave" único

Parece que ocurre un error porque el valor de la clave no se ingresa en la función de mapa, pero no sé cómo modificar el código.

La matriz está estructurada así:

 const tabContArr=[ { tabTitle:( <span className={activeIndex===0 ? "is-active" : ""} onClick={()=>tabClickHandler(0)}>0</span> ), }, { tabTitle:( <span className={activeIndex===1 ? "is-active" : ""} onClick={()=>tabClickHandler(1)}>1</span> ), }, { tabTitle:( <span className={activeIndex===2 ? "is-active" : ""} onClick={()=>tabClickHandler(2)}>2</span> ), }, { tabTitle:( <span className={activeIndex===3 ? "is-active" : ""} onClick={()=>tabClickHandler(3)}>3</span> ), } ];

Se produce un error en la parte de la función de mapa.

 {tabContArr.map((section)=>{ return section.tabTitle })}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Pruebe con React Fragments con un atributo key como se menciona en los documentos de React

 {tabContArr.map((section, index)=>{ return <React.Fragment key={`section-tab-${index}`}>{section.tabTitle}</React.Fragment> })}
about 4 years ago · Juan Pablo Isaza Report

0

Lo que has hecho no es el camino correcto. Si tiene datos, en lugar de pasar ReactElement a la matriz, debe pasarlos a la función de mapa de esta manera:

 {tabContArr.map((tab, index)=>{ return <span className={activeIndex === index ? "is-active" : ""} onClick={()=>tabClickHandler(index)} key={`tab-${index}`}>index</span> })}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!